#pragma once
#include<iostream>
#include<assert.h>
using namespace std;

typedef struct Stack
{
	int* a;
	int top;
	int capacity;
}Stack;

inline void StackInit(Stack* ps, int defaultcapacity = 4)
{
	assert(ps);
	ps->a = (int*)malloc(sizeof(int) * defaultcapacity);
	if (ps->a == NULL)
	{
		perror("malloc");
		return;
	}
	ps->top = 0;
	ps->capacity = defaultcapacity;
	
}
void StackPush(Stack* ps, int x);
void StackPush(Stack* ps, double x);